<template>
  <component
      :is="component"
      v-model="bean[prop as string]"
      :field="field"
      :disabled="disabled"
      :db="db"
  ></component>
</template>

<script setup lang="ts">
import {computed} from "vue";
import type {MetaField} from "../../types/tool/meta.types.ts";
import type {DaoTypes, DataItem} from "../../types/tool/dao.types.ts";
import {getComponentByDomain} from "./useCellComponents.ts";

const props = defineProps<{
  field: MetaField,
  bean: DataItem,
  db: DaoTypes,
  disabled: boolean,
}>()

const prop = computed(() => props.field.prop)
const component = computed(() => getComponentByDomain(props?.field?.domain || '-'))

</script>

<style scoped>

</style>